//
//  Utils.m
//  CallCenter
//
//  Created by aiquantong on 8/8/16.
//  Copyright © 2016 aiquantong. All rights reserved.
//

#import "HUDUtils.h"

@implementation HUDUtils

+ (void)showHUDOnWindowWithText:(NSString *)text
{
    UIWindow *wd = [UIApplication sharedApplication].keyWindow;
    MBProgressHUD * hud = [MBProgressHUD showHUDAddedTo:wd animated:YES];
    hud.labelText = text;
    hud.dimBackground = YES;
    hud.square = NO;
}


+ (void)showHUDTxtOnWindowWithText:(NSString *)text hiddenAfter:(NSInteger)delay;
{
    UIWindow *wd = [UIApplication sharedApplication].keyWindow;
    MBProgressHUD * hud = [MBProgressHUD showHUDAddedTo:wd animated:YES];
    hud.mode = MBProgressHUDModeText;
    hud.labelText = text;
    hud.dimBackground = YES;
    hud.square = NO;
    [hud hide:YES afterDelay:delay];
}


+ (void)hideHUDForWindow
{
    UIWindow *wd = [UIApplication sharedApplication].keyWindow;
    [MBProgressHUD hideAllHUDsForView:wd animated:YES];
}


@end
